<script>
	import config from '@/app.config.js'
	import {
		version
	} from './package.json'
	export default {
		methods: {

		},
		// 监听 - 页面404
		onPageNotFound: function(e) {
			uni.redirectTo({
				url: config.error.url
			})
		},
		onLaunch: function(options) {
      uni.getPushClientId({
      	success: (res) => {
      		let push_clientid = res.cid
      		console.log('客户端推送标识:',push_clientid)
      	},
      	fail(err) {
      		console.log(err)
      	}
      })
      uni.onPushMessage((res) => {
          console.log("收到推送消息：",res) //监听推送消息
        })
      let inviteCode = options.query.t
      if (inviteCode) {
        uni.setStorageSync('inviteCode', inviteCode)
      }
			// 注意：config.debug 在正式环境时，值为false，故此{}内的代码只有开发环境才会执行
			if (config.debug) {
				// #ifndef APP-PLUS
				console.log(
					`%c vk-client %c v${version} `,
					'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px;  color: #fff',
					'background:#007aff ;padding: 1px; border-radius: 0 3px 3px 0;  color: #fff; font-weight: bold;'
				);
				// #endif
				console.log('App Launch');
			}
		},
		onShow: function() {
			if (config.debug) console.log('App Show');
		},
		onHide: function() {
			if (config.debug) console.log('App Hide');
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "./common/css/font/iconfont.css";
	@import "./common/css/app.scss";
</style>
